<template>
    <sticky :z-index="10" :class-name="'sub-navbar tran fanhui_top'" style="margin-bottom: 10px;" >
        <el-button icon="el-icon-back"  type="warning" round @click="bk">返回</el-button>
        <el-button icon="el-icon-check" type="success" round @click="onClick" v-if="is_change">保存</el-button>
    </sticky>
</template>

<script>
import Sticky from '@/components/Sticky' // 粘性header组件
export default {
  name: 'FormHead',
  components: {Sticky},
    props: {
    rulesForm: {
      type: String,
      default: 'form'
    },
    is_change: {
      type: Boolean,
      default: false
    },
    isEdit: {
      type: Boolean,
      default: false
    },
},
  data() {
    return {
    }
  },
  methods:{
      // 返回
    bk() {
      if(this.isEdit){
        this.$store.commit('user/SET_EDIT','')
      }else{
        this.$back(1)//不缓存刷新表格的数组
      }
      
    },
    onClick() {
      this.$emit("onSubmit",this.rulesForm)
    },
  }
}
</script>


